package cn.walls1717.wallsmall.product.dao;

import cn.walls1717.wallsmall.product.entity.AttrGroupEntity;
import cn.walls1717.wallsmall.product.vo.SpuItemAttrGroupVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 属性分组
 * 
 * @author walls1717
 * @email walls1717@163.com
 * @date 2022-10-21 11:26:47
 */
@Mapper
public interface AttrGroupDao extends BaseMapper<AttrGroupEntity> {

    /**
     * 通过分类id获取所有属性分组id
     *
     * @param catelogId 分类id
     * @return attrGroupId集合
     */
    List<Long> getAttrGroupIdsByCatelogId(@Param("catelogId") Long catelogId);

    /**
     * 根据spuId与catalogId获取分组与属性相关信息
     *
     * @param spuId spuId
     * @param catalogId catalogId
     * @return SpuItemAttrGroupVO
     */
    List<SpuItemAttrGroupVO> listAttrGroupsWithAttrsBySpuIdCatalogId(@Param("spuId") Long spuId, @Param("catalogId") Long catalogId);
}
